#ifndef _FPGA_IO_H_
#define _FPGA_IO_H_

#include <linux/ioctl.h> /* needed for the _IOW etc stuff used later */
#include <asm/hardware.h>
#include <asm/io.h>
#include <linux/ioport.h>
#include <asm/arch-s3c2410/regs-gpio.h>
#include <asm/arch-s3c2410/regs-gpioj.h>



struct IO_mem_dev {
	struct semaphore sem;     /* mutual exclusion semaphore     */
	struct cdev cdev;	  /* Char device structure		*/
};

/*
 * Split minors in two parts
 */
#define TYPE(minor)	(((minor) >> 4) & 0xf)	
/* high nibble */
#define NUM(minor)	((minor) & 0xf)		
/* low  nibble */


/*
 * The different configurable parameters
 */
extern int IO_mem_major;     /* main.c */
extern int IO_mem_minor;



int     IO_mem_ioctl(struct inode *inode, struct file *filp,
                    unsigned int cmd, unsigned long arg);


/*
 * Ioctl definitions
 */

/* Use 'k' as magic number */
#define IO_MEM_MAGIC  'k'
/* Please use a different 8-bit number in your code */

#define IO_MEM_0    _IO(IO_MEM_MAGIC, 0)
#define IO_MEM_1 	_IO(IO_MEM_MAGIC, 1)
#define IO_MEM_2    _IO(IO_MEM_MAGIC,  2)
#define IO_MEM_3 	_IO(IO_MEM_MAGIC,  3)
#define IO_MEM_STATUS 	_IOR(IO_MEM_MAGIC,  4, int)

#define IO_MEM_MAXNR 4


#endif /* _SCULL_H_ */
